
function GetQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return (decodeURI(r[2]));
	return null;
}
function getrequestURL(){
	return "../../../";
}
function changeImg(id){
	var item="aitem"
	var src="";
	var img;
	for(var i=1;i<=4;i++){
		if((item+''+i)==id){
			document.getElementById(id).style.color="#01AEE3";
			img=document.getElementById(i+''+item);
			src=img.src;
			img.src=src.substring(0,src.length-5)+"2.png";
		}else{
			document.getElementById(item+''+i).style.color="#5b5b5b";
			img=document.getElementById(i+''+item);
			src=img.src;
			img.src=src.substring(0,src.length-5)+"1.png";
		}
	}
	
}
function removeNull(value){
	if(null==value||""==value){
		return "";
	}
	return value.trim();
}
function getCurrentTime(){
			    var date = new Date();
			    var seperator1 = "-";
			    var seperator2 = ":";
			    var month = date.getMonth() + 1;
			    var strDate = date.getDate();
			    var strHour=date.getHours();
			 	var strMinutes=date.getMinutes();
			    var strSeconds=date.getSeconds();
			    if (month >= 1 && month <= 9) {
			        month = "0" + month;
			    }
			    if (strDate >= 0 && strDate <= 9) {
			        strDate = "0" + strDate;
			    }
			    if (strHour >= 0 && strHour <= 9) {
			        strHour = "0" + strHour;
			    }
			    if (strMinutes >= 0 && strMinutes <= 9) {
			        strMinutes = "0" + strMinutes;
			    }
			    if (strSeconds >= 0 && strSeconds <= 9) {
			        strSeconds = "0" + strSeconds;
			    }
			  	var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate+" "+strHour+":"+strMinutes+":"+strSeconds;
				return currentdate;
}
function postLog(content,accountid,proVersion){
	//var url="../../../cty/APP";
	//var url="/Common_Interface/APP/visitLogRecord";
	var url="http://commoninter2.cumminsgps.cn/Common_Interface/APP/visitLogRecord";
	var oprtTime=getCurrentTime();
	var appType=3;
	var oprtContent=content;
	var accountId=accountid;
	var proVersion=proVersion;
	var accountName=localStorage.getItem("accountName");
	var userName=localStorage.getItem("userName");
	var accountType=localStorage.getItem("accountType");
	var appVersion=localStorage.getItem("appVersion");
	var haveValue="1";//1 有值 0无值
	if(accountName==null||accountName==""||accountName==undefined||userName==null||userName==""||userName==undefined){
		haveValue="0";
	}
	//var paramResult={param:'{"proVersion":"'+proVersion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","haveValue":"'+haveValue+'","data":[{"accountName":"'+accountName+'","userName":"'+userName+'","accountType":"'+accountType+'","appVersion":"'+appVersion+'","oprtContent":"'+oprtContent+'","oprtTime":"'+oprtTime+'","appType":"'+appType+'"}]}'}
	 var paramResult='param={"proVersion":"'+proVersion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","haveValue":"'+haveValue+'","data":[{"accountName":"'+accountName+'","userName":"'+userName+'","accountType":"'+accountType+'","appVersion":"'+appVersion+'","oprtContent":"'+oprtContent+'","oprtTime":"'+oprtTime+'","appType":"'+appType+'"}]}';
	 var scriptElement=document.createElement("script");
	 scriptElement.type="text/javascript";
	 scriptElement.src=url+"?"+paramResult;
	 document.body.appendChild(scriptElement);
/*	mui.ajax(url,{
				data:paramResult,
				dataType:'jsonp',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				timeout:1000000,//超时时间设置为10秒；
				success:function(data){
					var jsonObj = window.JSON.parse(data);
				},
				error:function(xhr,type,errorThrown){
					//异常处理；
					ulelementHtml.innerHTML="error";
				}
				
			});*/
}